// https://soj.turingedu.cn/problem/51001/
#include <algorithm>
#include <cstdio>
#include <cstring>
using namespace std;
using ll = long long;
const int inf = 0x3f3f3f3f;
#define rf(i, n) for (int i = 1; i <= (n); ++i)
int rad(); // read int
const int max_size = 5 + 100;
const int maxn = 5 + 100;

int n, m, tsiz;
int ans[maxn], tmp[maxn];

void dfs(int dep = 1) {
    if (dep >= m) return;
    if (tmp[dep - 1] > n) return;
    if (tmp[dep - 1] == n) {
        m = dep;
        memcpy(ans, tmp, sizeof(int) * m);
        return;
    }

    if (((ll)tmp[dep - 1] << (m - dep)) < n) return;

    for (int i = 0; i < dep; ++i) {
        for (int j = i; j < dep; ++j) {
            if (tmp[i] + tmp[j] > tmp[dep - 1]) {
                tmp[dep] = tmp[i] + tmp[j];
                dfs(dep + 1);
            }
        }
    }
}

int main() {
    tmp[0] = 1;
    while (n = rad()) {
        for (int i = 1; i <= 100; ++i) {
            m = i;
            dfs();
            if (ans[m - 1] == n) {
                break;
            }
        }
        for (int i = 0; i < m; ++i)
            printf("%d ", ans[i]);
        puts("");
    }
}

int rad() {
    int back = 0, ch = 0, neg = 0;
    for (; ch < '0' || ch > '9'; ch = getchar())
        neg = ch == '-';
    for (; ch >= '0' && ch <= '9'; ch = getchar())
        back = (back << 1) + (back << 3) + (ch & 0xf);
    return (back ^ -neg) + neg;
}